<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script>

		window.onload = function() {

			a1 = document.getElementById("title");

			a1.style.color = "red";

			a1.innerHTML = "百度一下";

			console.log(a1);

			a2 = document.getElementsByTagName('p')

			console.log(a2);

			a2[0].style.color = 'blue';

			a3 = document.getElementsByClassName('title')

			console.log(a3);

			for (var i = 0; i <= a3.length; i++) {
				a3[i].style.color = 'green';
			}

			
		}
	</script>
</head>
<body>
	<p>学并思1</p>
	<p class="title">学并思2</p>
	<p class="title">学并思2</p>
	<p class="title">学并思2</p>
	<p class="title">学并思2</p>
	<p id="title">学并思3</p>


</body>
</html>